<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf"%>
<script type="text/javascript" src="${ctx}/js/system/user/add.js">
	
</script>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
	position: relative;
	top: 9px;
	text-align: right;
}


.col-sm-9 {
	width: 32%;
	float: left;
	text-align: left;
}


label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post" action="${ctx}/workOrder/editWorkOrder.shtml">
		<input type="hidden" class="form-control" value="${user.bpid}"
			   name="worKOrderFormMap.bpid" id="bpid">
		<input type="hidden" name="worKOrderFormMap.stockid" id="stockid" value="${user.stockid}">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-sm-3">
					<label class="control-label">计划单号</label>
				</div>
				<div class="col-sm-9">
					<input type="text" class="form-control" name="worKOrderFormMap.bpcode" id="bpcode" readonly="readonly" value="${user.bpcode}">
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">编制人</label>
					<div class="col-sm-9">
						<select class="form-control selectpicker show-tick" data-live-search="true" name="worKOrderFormMap.bpedemid" id="bpedemid" >
							<c:forEach items="${emp}" var="emps">
								<c:choose>
									<c:when test="${emps.empId == user.bpedemid}">
										<option value="${emps.empId}" selected = "selected">${emps.empName}</option>
									</c:when>
									<c:otherwise>
										<option value="${emps.empId}">${emps.empName}</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>

					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">成品名称</label>
				<div class="col-sm-9">
					<input type="text" class="form-control" name="worKOrderFormMap.stockname" id="stockname" value="${user.stockname}">
					<span class="input-group-btn">
							<button class="btn btn-info" id="workorder" type="button"
									style="height: 34px; position: absolute; top: -34px; left: 230px;"
									onclick="getBomInfo();">
								<span class="glyphicon glyphicon-search"></span>
							</button>
					</span>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">计划数量</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" name="worKOrderFormMap.num" id="num"  value="${user.num}">
					</div>
				</div>

			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">生产车间</label>
				<div class="col-sm-9">
					<select class="form-control" name="worKOrderFormMap.depid" id="depid">
						<c:forEach items="${dep}" var="d">
							<c:choose>
								<c:when test="${d.deid == user.depid}">
									<option value="${d.deid}" selected = "selected">${d.dename}</option>
								</c:when>
								<c:otherwise>
									<option value="${d.deid}">${d.dename}</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>

					</select>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">计划状态</label>
					<div class="col-sm-9">
						<select class="form-control" name="worKOrderFormMap.bpbillstateid" id="bpbillstateid">
							<option value="1" <c:if test="${user.bpbillstateid == 1}">selected</c:if> >完成</option>
							<option value="2" <c:if test="${user.bpbillstateid == 2}">selected</c:if>>未完成</option>
							<option value="3" <c:if test="${user.bpbillstateid == 3}">selected</c:if>>下达</option>
							<option value="4" <c:if test="${user.bpbillstateid == 4}">selected</c:if>>等待</option>
							<option value="5" <c:if test="${user.bpbillstateid == 5}">selected</c:if>>计划</option>
							<option value="6" <c:if test="${user.bpbillstateid == 6}">selected</c:if>>生产中</option>
						</select>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">订购日期</label>
				<div class="col-sm-9">
					<input type="date" class="form-control"
						   name="worKOrderFormMap.bpbtime"
						   id="bpbtime" value="${user.bpbtime}">
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">要求日期</label>
					<div class="col-sm-9">
						<input type="date" class="form-control"
							   name="worKOrderFormMap.bpetime"
							   id="bpetime" value="${user.bpetime}">
					</div>
				</div>
            </div>


			<footer class="panel-footer text-right bg-light lter">
			<button type="submit" class="btn btn-success btn-s-xs">提交</button>
			</footer>
		</div>
		</section>
	</form>

	<script type="text/javascript">
		onloadurl();
	</script>
	<script type="text/javascript"
		src="${ctx}/notebook/notebook_files/bootstrap-filestyle.min.js"></script>
</body>
</html>